﻿using System.Threading;
using System.Threading.Tasks;
using Xms.Abp.BackgroundJob;

namespace IdentityServerManagement.Tokens;

[BackgroundJobName("登录令牌清理")]
public class TokenCleanupBackgroundJob : BackgroundJob<TokenCleanupBackgroundJobArgs>
{
    protected TokenCleanupService TokenCleanupService { get; }
    public TokenCleanupBackgroundJob(TokenCleanupService tokenCleanupService)
    {
        TokenCleanupService = tokenCleanupService;
    }
    public override async Task ExecuteAsync(TokenCleanupBackgroundJobArgs args, CancellationToken cancellationToken = default)
    {
        await TokenCleanupService.CleanAsync(cancellationToken);
    }
}
